# -*- coding: utf-8 -*-
# @Time    : 2021/4/18 15:24
# @Author  : N
# @Email   : 
# @File    : 统计字符串中每个单词出现的次数.py
# @Software: PyCharm
s="abc,ddf,fad,lsd,ddf,abc,abc,ddf,fad"
c=s.split(",")
b=s.split(",")
for i in b:
    for j in b[b.index(i)+1:]:
        if i==j:
            b.remove(j)
for k in range(len(b)):
    print(b[k],"出现的次数为：",c.count(b[k]))




